CREATE OR REPLACE FUNCTION MODERN.unwrap_profile(p_id_from NUMBER, p_id_to NUMBER)
RETURN MODERN.TBL_IKL_TO_EXCEL PIPELINED
IS
BEGIN
	FOR rec IN (
		SELECT
			i."ID"
		FROM
			modern.ikl i
		WHERE i."ID" BETWEEN p_id_from AND p_id_to 
	)
	LOOP
		pipe ROW(modern.unwrap_profile_row(rec.id));
	END LOOP;
END;
/
